import React from 'react';
import { myContext_two } from './ContextBox';

console.group('context chil3 组件学习');
class ContextChil3 extends React.Component {
  /* 使用 ContextType 来获取指定 context 的值 */
  static contextType = myContext_two;

  render() {
    const useContextTypeGetContextValue = this.context;
    // console.log( useContextTypeGetContextValue, this );
    return (
      <div>
        <h2>Context chil3 包含类组件函数组件 -》》》</h2>
        <p>在类组件中使用数据{JSON.stringify(useContextTypeGetContextValue)}</p>
      </div>
    );
  }
}
console.groupEnd();
export default ContextChil3;
